# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Ian D, Scott <ian@perebruin.com>

pkgname=wikicurses
pkgver=1.4
pkgrel=7
pkgdesc="A simple curses interface for accessing Wikipedia"
arch=('any')
url="https://github.com/ids1024/wikicurses"
license=('MIT')
depends=(
  'python'
  'python-urwid'
  'python-beautifulsoup4'
  'python-lxml'
)
makedepends=('python-setuptools')
backup=('etc/wikicurses.conf')
source=(
  "$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
  "$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz.asc"
)
sha512sums=('9473c01e58b70f4ea92b9615ed4f437139a2463a5b712209e2091425e9c5ee967f23f6703d7d2548162e94ccace99273cec41ed139a4d49c8e7063ff303ab063'
            'SKIP')
b2sums=('d9ca4feefbfae42dd1431ad2cc48a149186e1351676a826e70c878f0f04f50107962c80b4a6eaa4c9449df80321a1023049ff1c7a9527fa12ecc3054e2bfc45e'
        'SKIP')
validpgpkeys=('098BF569A360E234CE2B861A4924E10E199B5959') # Ian D. Scott <ian@perebruin.com>

build() {
  cd "$pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$pkgname-$pkgver"

  python setup.py install \
    --root="${pkgdir}" \
    --optimize=1 \
    --skip-build

  # documentation
  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
